﻿// 员工基本信息模型
Ext.define('BasicInfoModel', {
    extend: 'Ext.data.Model',
    fields: [
        "Id"
	    , "Name"   //姓名
		, "Gender"   //性别
		, "Birthday"   //生日
		, "Age"   //年龄
		, "Nationality"   //名族
		, "Marriage"   //婚姻
		, "CitizenShip"   //国籍
		, "BloodType"   //血型
		, "Birthplace"   //出生地
		, "PoliticsStatus"   //政治面貌
		, "Credential"   //证件
		, "FilesPlace"   //档案所在地
		, "DomicilePlace"   //户口所在地
		, "Photo"   //照片
		, "Email"   //邮箱
		, "PrivateEmail"   //私人邮箱
		, "MobilePhone"   //移动电话
		, "PersonalUrl"   //个人主页
		, "Interests"   //兴趣爱好
		, "Fax"   //传真
		, "Address"   //住址
        , "CustomerId" //客户Id
        , "CustomerName" //客户名称
    ],
    idProperty: "Id"
});

Ext.define("SHApp.CompanyManage.CompanyLinkman.EmployeeComboBox", {
    extend: "BLBTSystem.CmbData",
    alias: "widget.employeeComboBox",
    dataUrl: "api/basicinfoQ?format=json",
    model: "BasicInfoModel",
    matchFieldWidth: false,
    sorters: [{
        property: 'Name',
        direction: 'ASC'
    }],
    listConfig: {
        resizable: true,
        width: 300
    },
    minChars: 1,
    valueField: "Id",
    displayField: "Name",
    maxLength: 100,
    forceSelection: false,
    initComponent: function () {
        Ext.apply(this);
        this.callParent(arguments);
    },
    loadByCompany: function (companyId) {
        this.dataUrl = "api/basicinfoQ?format=json&CustomerId=" + encodeURIComponent(companyId);
        this.reLoadData();
    }
});
